.class public Lcom/xiaomi/notes/NoteAlertDialogActivity;
.super Landroid/app/Activity;
.source "NoteAlertDialogActivity.java"

# interfaces
.implements Landroid/content/DialogInterface$OnClickListener;


# static fields
.field public static context:Lcom/xiaomi/notes/NoteAlertDialogActivity;


# instance fields
.field private nId:I

.field private player:Landroid/media/MediaPlayer;

.field private strViewInfo:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 17
    const/4 v0, 0x0

    sput-object v0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->context:Lcom/xiaomi/notes/NoteAlertDialogActivity;

    return-void
.end method

.method public constructor <init>()V
    .locals 1

    .prologue
    .line 16
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 19
    new-instance v0, Landroid/media/MediaPlayer;

    invoke-direct {v0}, Landroid/media/MediaPlayer;-><init>()V

    iput-object v0, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    .line 21
    const/4 v0, 0x0

    iput v0, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->nId:I

    .line 23
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->strViewInfo:Ljava/lang/String;

    return-void
.end method

.method private init()V
    .locals 5

    .prologue
    .line 44
    :try_start_0
    sget-object v3, Lcom/xiaomi/notes/NoteAlertDialogActivity;->context:Lcom/xiaomi/notes/NoteAlertDialogActivity;

    const/4 v4, 0x4

    invoke-static {v3, v4}, Landroid/media/RingtoneManager;->getActualDefaultRingtoneUri(Landroid/content/Context;I)Landroid/net/Uri;

    move-result-object v2

    .line 46
    .local v2, url:Landroid/net/Uri;
    iget-object v3, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    if-eqz v3, :cond_0

    if-eqz v2, :cond_0

    .line 47
    iget-object v3, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    sget-object v4, Lcom/xiaomi/notes/NoteAlertDialogActivity;->context:Lcom/xiaomi/notes/NoteAlertDialogActivity;

    invoke-virtual {v3, v4, v2}, Landroid/media/MediaPlayer;->setDataSource(Landroid/content/Context;Landroid/net/Uri;)V

    .line 48
    iget-object v3, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    invoke-virtual {v3}, Landroid/media/MediaPlayer;->prepare()V

    .line 49
    iget-object v3, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    const/4 v4, 0x0

    invoke-virtual {v3, v4}, Landroid/media/MediaPlayer;->setLooping(Z)V

    .line 50
    iget-object v3, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    invoke-virtual {v3}, Landroid/media/MediaPlayer;->start()V
    :try_end_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/lang/SecurityException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_2
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3

    .line 63
    .end local v2           #url:Landroid/net/Uri;
    :cond_0
    :goto_0
    new-instance v0, Landroid/app/AlertDialog$Builder;

    sget-object v3, Lcom/xiaomi/notes/NoteAlertDialogActivity;->context:Lcom/xiaomi/notes/NoteAlertDialogActivity;

    invoke-direct {v0, v3}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 64
    .local v0, dialog:Landroid/app/AlertDialog$Builder;
    const/high16 v3, 0x7f05

    invoke-virtual {v0, v3}, Landroid/app/AlertDialog$Builder;->setTitle(I)Landroid/app/AlertDialog$Builder;

    .line 65
    iget-object v3, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->strViewInfo:Ljava/lang/String;

    invoke-virtual {v0, v3}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    .line 66
    const v3, 0x7f050068

    invoke-virtual {v0, v3, p0}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 67
    const v3, 0x7f050069

    invoke-virtual {v0, v3, p0}, Landroid/app/AlertDialog$Builder;->setNegativeButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 68
    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->show()Landroid/app/AlertDialog;

    .line 69
    return-void

    .line 52
    .end local v0           #dialog:Landroid/app/AlertDialog$Builder;
    :catch_0
    move-exception v3

    move-object v1, v3

    .line 53
    .local v1, e:Ljava/lang/IllegalArgumentException;
    invoke-virtual {v1}, Ljava/lang/IllegalArgumentException;->printStackTrace()V

    goto :goto_0

    .line 54
    .end local v1           #e:Ljava/lang/IllegalArgumentException;
    :catch_1
    move-exception v3

    move-object v1, v3

    .line 55
    .local v1, e:Ljava/lang/SecurityException;
    invoke-virtual {v1}, Ljava/lang/SecurityException;->printStackTrace()V

    goto :goto_0

    .line 56
    .end local v1           #e:Ljava/lang/SecurityException;
    :catch_2
    move-exception v3

    move-object v1, v3

    .line 57
    .local v1, e:Ljava/lang/IllegalStateException;
    invoke-virtual {v1}, Ljava/lang/IllegalStateException;->printStackTrace()V

    goto :goto_0

    .line 58
    .end local v1           #e:Ljava/lang/IllegalStateException;
    :catch_3
    move-exception v3

    move-object v1, v3

    .line 59
    .local v1, e:Ljava/io/IOException;
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_0
.end method


# virtual methods
.method public onClick(Landroid/content/DialogInterface;I)V
    .locals 4
    .parameter "dialog"
    .parameter "which"

    .prologue
    .line 73
    iget-object v1, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    if-eqz v1, :cond_0

    .line 74
    iget-object v1, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    invoke-virtual {v1}, Landroid/media/MediaPlayer;->stop()V

    .line 75
    const/4 v1, 0x0

    iput-object v1, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->player:Landroid/media/MediaPlayer;

    .line 77
    :cond_0
    packed-switch p2, :pswitch_data_0

    .line 92
    :goto_0
    return-void

    .line 79
    :pswitch_0
    invoke-virtual {p0}, Lcom/xiaomi/notes/NoteAlertDialogActivity;->finish()V

    goto :goto_0

    .line 83
    :pswitch_1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 84
    .local v0, i:Landroid/content/Intent;
    new-instance v1, Landroid/content/ComponentName;

    sget-object v2, Lcom/xiaomi/notes/NoteAlertDialogActivity;->context:Lcom/xiaomi/notes/NoteAlertDialogActivity;

    const-class v3, Lcom/xiaomi/notes/NoteListActivity;

    invoke-direct {v1, v2, v3}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    .line 85
    const-string v1, "DESKTOP_TO_APP_FLAG_TYPE"

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 87
    const-string v1, "DESKTOP_TO_APP_FLAG_ID"

    iget v2, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->nId:I

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 88
    invoke-virtual {p0, v0}, Lcom/xiaomi/notes/NoteAlertDialogActivity;->startActivity(Landroid/content/Intent;)V

    .line 89
    invoke-virtual {p0}, Lcom/xiaomi/notes/NoteAlertDialogActivity;->finish()V

    goto :goto_0

    .line 77
    nop

    :pswitch_data_0
    .packed-switch -0x2
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 2
    .parameter "info"

    .prologue
    .line 27
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 29
    invoke-virtual {p0}, Lcom/xiaomi/notes/NoteAlertDialogActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const-string v1, "XM_NOTE_TITLE"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->strViewInfo:Ljava/lang/String;

    .line 30
    invoke-virtual {p0}, Lcom/xiaomi/notes/NoteAlertDialogActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;

    move-result-object v0

    const-string v1, "XM_NOTE_ID"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I

    move-result v0

    iput v0, p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->nId:I

    .line 32
    sput-object p0, Lcom/xiaomi/notes/NoteAlertDialogActivity;->context:Lcom/xiaomi/notes/NoteAlertDialogActivity;

    .line 33
    invoke-direct {p0}, Lcom/xiaomi/notes/NoteAlertDialogActivity;->init()V

    .line 34
    return-void
.end method

.method protected onDestroy()V
    .locals 0

    .prologue
    .line 38
    invoke-super {p0}, Landroid/app/Activity;->onDestroy()V

    .line 39
    return-void
.end method
